package com.xyz.cmsservice.controller;

import com.xyz.entity.R;
import com.xyz.cmsservice.entity.CrmBanner;
import com.xyz.cmsservice.service.CrmBannerService;

import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zsr
 * @date 2021/6/17 22:16
 */
@Schema(description="前台banner接口")
@RestController
@RequestMapping("/cmsservice/bannerfront")
//@CrossOrigin
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    /**
     * 查询所有的banner
     * @return
     */
//    //@Cacheable(value = "banner", key = "'selectIndexList'")
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);

    }
}
